<template>
  <section class="carTypeConfig">
    <el-col :span="span">
      <lableName    :validrule="validrule"   
        :curLabelName="curLabelName"
        :isShowLabel="isShowLabel"
        :isRequire="isRequire"
      ></lableName>
      <el-input
        placeholder="请选择"
        v-model="modelText"
        :disabled="disabled"
        size="small"
        suffix-icon="el-icon-menu"
        @clear="clearCode"
        clearable
        @blur="sendCode"
        @focus="getFocusCode"
      ></el-input>
      <validateFormate
        :curLabelName="curLabelName"
        :validrule="validrule"
      ></validateFormate>
    </el-col>
    <pageSelect
      :popupsVisible="curPopupsVisible"
      :codeField="codeField"
      :textField="textField"
      :comType="comType"
      :valueObject="curValueObject"
      :popupsKey="popupsKey"
      :code="modelCode"
      :text="modelText"
      :key="curPopupsKey"
      :isMul="isMul"
      :returnCodeField="returnCodeField"
      :returnTextField="returnTextField"
      @changeCode="getComponentCode"
    ></pageSelect>
  </section>
</template>
<script>
import { searchInputMixins } from "@/components/mixins/searchInputMixins";
import { valueObjectMixins } from "@/components/mixins/valueObjectMixins";
// import lableName from "@/components/lableName";
import pageSelect from "@/components/crm/crmEjectWindows/crmPageSelect/pageSelect";
// import validateFormate from "@/components/validateFormate";
export default {
  // 组件混入对象
  mixins: [searchInputMixins, valueObjectMixins],
  components: {
    pageSelect,
    lableName: () => import("@/components/lableName"), //标题溢出样式组件
    validateFormate: () => import("@/components/validateFormate"), //校验提示样式组件
  },
  data() {
    return {
      curLabelName: this.labelName === "" ? "自定义页面" : this.labelName
    };
  },
  methods: {
    //传递网格列数据
    // getComponentCode(code, text,codeField,comType,popupsKey,textField,otherField, selectData) {
    //   debugger
    //   var parent = this.$utils.getHasFormFieldParentComponent(this);
    //   parent.formField[codeField]=code;
    //   this.$emit("changeCode",selectData);
    //   this.modelText = text;
    //   this.curPopupsVisible = false;
    // },
    // 重写显示时执行事件
    onShow() {
      var parent = this.$utils.getHasFormFieldParentComponent(this);
      if (
        parent.formField &&
        parent.formField.elementType &&
        parent.formField.elementType !== ""
      ) {
        //赋值
        this.curValueObject.linkType = parent.formField.elementType;
        this.curPopupsKey = this.codeField + this.$utils.generateId();
      }
    }
  }
};
</script>
